package jmine.tec.database.query.columns;

import static java.sql.Types.BIGINT;
import static java.sql.Types.DECIMAL;
import static java.sql.Types.DOUBLE;
import static java.sql.Types.FLOAT;
import static java.sql.Types.INTEGER;
import static java.sql.Types.NUMERIC;
import static java.sql.Types.REAL;
import static java.sql.Types.SMALLINT;
import static java.sql.Types.TINYINT;
import jmine.tec.database.query.Column;
import jmine.tec.database.query.ColumnFactory;

/**
 * Fábrica de colunas que suportam valores que podem ser representados como BigDecimal.
 * 
 * @author lundberg
 */
public class NumericColumnFactory implements ColumnFactory {

    /**
     * {@inheritDoc}
     */
    public Column create(int type, String name) {
        return new NumericColumn(type, name);
    }

    /**
     * {@inheritDoc}
     */
    public int[] getSupportedTypes() {
        return new int[]{ TINYINT, SMALLINT, INTEGER, BIGINT, FLOAT, REAL, DOUBLE, NUMERIC, DECIMAL };
    }
}
